No matter how good of a programmer you are, you will eventually want to debug your VBScript code, if not due to programming errors, then due to use cases or data that you did not anticipate. The Visual Studio programmer has the convenience of a debugger built into that development tool but beyond the script validation feature of the Meridian Enterprise Script Editor, you cannot debug VBScript in the editor. For real debugging, you need a different tool. The tool to use depends on the client application where you want to debug the script:
The key to debugging VBScript from applications other than PowerUser is the ability of Visual Studio to attach itself to those applications.
Before you begin
Visual Studio 2008 or higher must be installed on the computer running the application from which you want to debug. Other debugging tools can be used as long as they support attaching themselves to a running process.
To debug VBScript in any Windows application with Visual Studio:
In Project Types, expand Other Project Types, click Visual Studio Solutions, select Blank Solution, and then click OK. A new project is created.
Note The name of the project is irrelevant because you will not add any code to the project and will discard it when you are finished using the debugger.
Perform the action in the host application that will run the VBScript code that you want to debug. The Windows focus switches to Visual Studio and a new window opens, either VBScript - script block [dynamic] if a configuration expression is about to execute or BlueCielo VB Script [dynamic] if a sub-procedure or function in the event handler code module is about to execute. The next statement that will execute is highlighted and execution stops to allow you to debug.
When script first executes after the process is attached to Visual Studio, the vault's active VBScript configuration expressions and the event handler code module are loaded in Visual Studio. You might have to step over (press F10) some configuration expressions or sub-procedures before the particular expression, sub-procedure, or function that you want to debug is entered. Whenever the event handler code module is loaded, you can set breakpoints in the BlueCielo VB Script [dynamic] window and step through the code similar to debugging in PowerUser as described in Understanding the Microsoft Script Debugger.
To open the BlueCielo VB Script [dynamic] window, in the Solution Explorer expand Script Documents, expand AMScriptHost, and double-click BlueCielo VB Script.
Just like with using the Microsoft Script Debugger, to make changes to script code, you must edit it in Meridian Enterprise Configurator, save your changes, reopen the vault in the host application, and restart this task from step 5.
Following is a list of host applications related to Meridian Enterprise that you can attach to debug VBScript code:
To further aid in debugging, you can enable logging of VBScript events, command scripts, evaluated expressions, and external function calls. You can enable logging only for PowerUser and the Meridian Web Client.
To enable VBScript logging and viewing:
In the Windows registry of the client PC, set the following registry values that are also described in the BlueCielo Meridian Enterprise Administrator's Guide:
The log file is restarted for each client session. The file includes the time, description, and source of the events.
To view the log with PowerUser:
To download the log with the Meridian Web Client:
Related concepts
Understanding the Meridian Enterprise Script Editor
Understanding the Microsoft Script Debugger
Understanding configuration expressions
Understanding the Meridian object model
Understanding the Meridian functions
Understanding Meridian event procedures
Understanding automation objects
Understanding object arguments
Understanding VBScript and the Meridian Web Client
Understanding the CurrentPropertyName property
Related information
Formatting text with RTF codes